sizerequest: Split out size request cache code into separate header
authorBenjamin Otte <otte@redhat.com>
Tue, 13 Nov 2012 12:41:05 +0000 (13:41 +0100)
committerBenjamin Otte <otte@redhat.com>
Wed, 14 Nov 2012 00:55:28 +0000 (01:55 +0100)
gtk/Makefile.am
gtk/gtksizerequest.c
gtk/gtksizerequestcacheprivate.h [new file with mode: 0644]
gtk/gtkwidget.c
gtk/gtkwidgetprivate.h

index 76f09cf18a02c96b8e469d8fd59cb6f8925c85ea..61d396e61741e150385f55814104d52c7ce714d4 100644 (file)
@@ -519,6 +519,7 @@ gtk_private_h_sources =             \
        gtkselectionprivate.h   \
        gtksettingsprivate.h    \
        gtksizegroup-private.h  \
+       gtksizerequestcacheprivate.h    \
        gtksocketprivate.h      \
        gtkstyleanimationprivate.h \
        gtkstylecascadeprivate.h \
index e77ecd60db48494c554aa4ba7f20b326fb9b929f..8404bd6b29b04b196e43ae9f0600a53ae7a5843e 100644 (file)
@@ -27,6 +27,7 @@
 #include "gtkintl.h"
 #include "gtkprivate.h"
 #include "gtksizegroup-private.h"
+#include "gtksizerequestcacheprivate.h"
 #include "gtkwidgetprivate.h"
 #include "deprecated/gtkstyle.h"
 
diff --git a/gtk/gtksizerequestcacheprivate.h b/gtk/gtksizerequestcacheprivate.h
new file mode 100644 (file)
index 0000000..143d2b0
--- /dev/null
@@ -0,0 +1,69 @@
+/* GTK - The GIMP Toolkit
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
+ * file for a list of people on the GTK+ Team.  See the ChangeLog
+ * files for a list of changes.  These files are distributed with
+ * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifndef __GTK_SIZE_REQUEST_CACHE_PRIVATE_H__
+#define __GTK_SIZE_REQUEST_CACHE_PRIVATE_H__
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+/* Cache as many ranges of height-for-width
+ * (or width-for-height) as can be rational
+ * for a said widget to have, if a label can
+ * only wrap to 3 lines, only 3 caches will
+ * ever be allocated for it.
+ */
+#define GTK_SIZE_REQUEST_CACHED_SIZES   (5)
+
+typedef struct {
+  gint minimum_size;
+  gint natural_size;
+} CachedSize;
+
+typedef struct
+{
+  gint       lower_for_size; /* The minimum for_size with the same result */
+  gint       upper_for_size; /* The maximum for_size with the same result */
+  CachedSize cached_size;
+} SizeRequest;
+
+typedef struct {
+  SizeRequest **widths;
+  SizeRequest **heights;
+
+  CachedSize  cached_width;
+  CachedSize  cached_height;
+
+  guint       cached_widths      : 3;
+  guint       cached_heights     : 3;
+  guint       last_cached_width  : 3;
+  guint       last_cached_height : 3;
+  guint       cached_base_width  : 1;
+  guint       cached_base_height : 1;
+} SizeRequestCache;
+
+G_END_DECLS
+
+#endif /* __GTK_SIZE_REQUEST_CACHE_PRIVATE_H__ */
index eb82eb8878a9e2f4c2d8b2d6024e8db521579c31..27353b9b26d46e07e9290d4c8f759311428eecd4 100644 (file)
@@ -41,6 +41,7 @@
 #include "gtkselectionprivate.h"
 #include "gtksettingsprivate.h"
 #include "gtksizegroup-private.h"
+#include "gtksizerequestcacheprivate.h"
 #include "gtkwidget.h"
 #include "gtkwidgetprivate.h"
 #include "gtkwindowprivate.h"
index 3ebd8ebf6219d6cf5b10ab49715c5c862a635f9d..06ba4afa5e3bab5dc00f5fb9997ea9f1eb4fde7c 100644 (file)
 
 G_BEGIN_DECLS
 
-/* Cache as many ranges of height-for-width
- * (or width-for-height) as can be rational
- * for a said widget to have, if a label can
- * only wrap to 3 lines, only 3 caches will
- * ever be allocated for it.
- */
-#define GTK_SIZE_REQUEST_CACHED_SIZES   (5)
-
-typedef struct {
-  gint minimum_size;
-  gint natural_size;
-} CachedSize;
-
-typedef struct
-{
-  gint       lower_for_size; /* The minimum for_size with the same result */
-  gint       upper_for_size; /* The maximum for_size with the same result */
-  CachedSize cached_size;
-} SizeRequest;
-
-typedef struct {
-  SizeRequest **widths;
-  SizeRequest **heights;
-
-  CachedSize  cached_width;
-  CachedSize  cached_height;
-
-  guint       cached_widths      : 3;
-  guint       cached_heights     : 3;
-  guint       last_cached_width  : 3;
-  guint       last_cached_height : 3;
-  guint       cached_base_width  : 1;
-  guint       cached_base_height : 1;
-} SizeRequestCache;
-
 void         _gtk_widget_set_visible_flag   (GtkWidget *widget,
                                              gboolean   visible);
 gboolean     _gtk_widget_get_in_reparent    (GtkWidget *widget);